﻿using EnumHelpers;
using Interview.Model.Enum;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Interview.Model
{
    /// <summary>
    /// 奶茶
    /// </summary>
    public class MilkTea
    {
        public CupgradeEnum cupgrade { get; set; }
        public List<Ingredient> Ingredients { get; set; } = new List<Ingredient>();

        public MilkTea(CupgradeEnum cupgrade)
        {
            this.cupgrade = cupgrade;
        }

        public void AddIngredient(Ingredient ingredient)
        {
            Ingredients.Add(ingredient);
        }

        public override string ToString()
        {

            string sizeStr = cupgrade switch
            {
                CupgradeEnum.Small => "小杯",
                CupgradeEnum.Medium => "中杯",
                CupgradeEnum.Big => "大杯",
                _ => ""
            };
            string ingredientsStr = string.Join("", Ingredients.Select(i => i.ToString()));
            return $"{sizeStr}{ingredientsStr}";
        }

    }
}
